#pragma once

#include "zlib\zlib.h"

namespace HttpUtility
{
	int GetHttpHeaderLength(const char* p, int n);
	bool GetHttpHeader(const char* header, int headerlen, const char* name, const char*& value, int& len);
	CString GetHttpRequestURL(const char* p, int n, u_long addr, u_short port);
	int GetHttpRequestLength(const char* p, int n, int header);
	int GetHttpResponseStatusCode(const char* header);
	int GetHttpResponseChunkedLength(const char* p, int n, int& cl);
	int GetHttpResponseLength(const char* p, int n, int header, bool closed, bool& chunked, int& cl);
	int GetHttpResponseChunkedData(u_char* data, int size, const char* p);
	int GetHttpResponseData(u_char* data, int size, const char* p, int n, int header, bool chunked);
	int gzipDecode(Byte *zdata, uLong nzdata, Byte *data, uLong ndata);
}
